package com.smz.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smz.dao.SiteDAO;
import com.smz.entity.Site;
import com.smz.service.SiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class SiteServiceImpl extends ServiceImpl<SiteDAO, Site> implements SiteService {
    @Autowired
    private SiteDAO siteDAO;


    @Override
    public void addSite(Site site) {
        siteDAO.insert(site);
    }

    @Override
    public void modifySite(Site site) {
        siteDAO.updateById(site);
    }

    @Override
    public void removeSite(Integer id) {
        siteDAO.deleteById(id);
    }

    @Override
    public IPage<Site> findByPage(int current,int size) {
        return siteDAO.findByPage(new Page(current,size));
    }
}
